import 'dart:convert';

import 'package:study_demo/api/bean.dart';
import 'package:study_demo/ext/tile_ext.dart';
import 'package:tile/tile.dart';

const BASE_URL = "http://app.izis.cn/GoWebService/";

const NEWSPHOTO_URL = "http://app.izis.cn:8080/GoWebService/NewsPhoto/";

/// 棋力测试
const level_test = "1025";

String levelTestInfo(int userId, String level) {
  return "{\"root\":[{\"userid\":\"$userId\",\"level\":\"$level\"}]}";
}

/// 获取题目大类
const topic_super = "1005";

String emptyInfo() {
  return "";
}

/// 获取题目小类
const topic_subgrouptopic = "1007";

String topicSubGroupTopicInfo(int superid) {
  return "{\"root\":[{\"super_id\"::\"$superid\"}]}";
}

/// 获取题目
const topic = "1024";

String topicInfo(int tags) {
  return "{\"root\":[{\"tags\":\"$tags\"}]}";
}

/// 上传错题
const upload_wrong = "1026";

/// 获取首页网络图片
const news_photo = "1033";

/// 验证短信
const verify_sms = "010105";

String verifySmsInfo(int userId, String level) {
  return "{\"root\":[{\"userid\":\"$userId\",\"level\":\"$level\"}]}";
}

/// 以题会友
/// 发布帖子
const release_invitation = '1001';
String releaseInvitation() {
  return '';
}

/// 帖子列表
const invitation_list = '1001';
String invitationListInfo(int pageIndex) {
  return "{\"root\":[{\"keyWord\":\"" +
      "" +
      "\",\"pageIndex\":\"$pageIndex\",\"pageSize\":5}]}";
}

/// 评论列表
const comment_list = '1002';
String commentListInfo(int topicId, int pageIndex, int sort) {
  return "{\"root\":[{\"topic_id\":$topicId,\"pageSize\":5,\"pageIndex\":$pageIndex,\"sort\":$sort}]}";
}

/// 删除帖子
const delete_invitation = '1003';
String deleteInvitationInfo(int id) {
  return "{\"root\":[{\"id\":$id}]}";
}

/// 删除评论
const delete_comment = '1004';
String deleteCommentInfo(int id, int topicId) {
  return "{\"root\":[{\"id\":$id,\"topic_id\":$topicId}]}";
}

/// 置顶帖子
const maketop_invitation = '1016';
String makeTopInvitationInfo(int id) {
  return "{\"root\":[{\"id\":$id}]}";
}

/// 给帖子点赞
const praise_invitation = '1022';
String praiseInvitationInfo(int topicId, int userId) {
  return "{\"root\":[{\"topid\":$topicId,\"userid\":\"$userId\"}]}";
}

/// 回复帖子
const reply_invitation = '1002';
String replyInvitationInfo(int userId, int topicId, String commentary) {
  return "{\"userid\":$userId,\"topic_id\":$topicId,\"commentary\":\"$commentary\"}";
}

/// 棋盘信息
const board_info = '5016';

String boardInfo(String code) {
  return "{\"root\":[{\"boardid\":\"$code\"}]}";
}

/// 棋盘信息
const board_detail_info = '010102';

String boardDetailInfo(String decode) {
  return "{\"root\":[{\"decode\":\"$decode\"}]}";
}

/// 激活状态
const activate_status = '010102';

/// 修改棋盘信息
const change_board_info = '0006';

String changeBoardInfo(BoardInfo boardInfo) {
  return jsonEncode(boardInfo.toJson());
  ;
}

String activateStatusInfo(String decode) {
  return "{\"root\":[{\"decode\":\"$decode\"}]}";
}

/// 登录
const login_code = '0001';

String loginInfo(String name, String password) {
  return "{\"root\":[{\"name\":\"$name\",\"pwd\":\"$password\"}]}";
}

const game_detail = '020102';

String gameDetailInfo(int gameId) {
  return "{\"root\":[{\"gameid\":$gameId,\"type\":3}]}";
}

const game_detail_code = "020115";

String gameDetailCodeInfo(int id) => ("{\"root\":[{\"Id\":\"$id\"}]}");

const galaxy_ai = '010104';

const leena_ai = '010101';

const kata_ai = '010110';

const kata_lower_level = '010118'; // 8大种族

const leena_hot_photo = '010109';

const kata_hot_photo = '010112';

const recommend_board_kata = '010111';

// 19路推荐点
const recommend_board_leena = '010103';

///数子
const count_code = '010114';

String count_info(Board board) => '${board.getBoardSize()}#${board.allStep}#21';

///形势
const situation_code = '010113';

String liveDetailWebInfo(int gameId, int type) =>
    "{\"root\":[{\"gameid\":$gameId,\"type\":$type,\"state\":1}]}";

/// 获取用户信息
const user_info = '010101-1';

String userInfoInfo(String userName, String password) {
  return "{\"root\":[{\"loginname\":\"$userName\",\"password\":\"$password\"}]}";
}

const board_code_info = '5012-1';

String boardCodeInfo(String searchStr) {
  return "{\"root\":[{\"year\":0,\"month\":0,\"day\":0,\"curPage\":1,\"rowsPerPage\":20,\"searchStr\":\"$searchStr\"}]}";
}

const board_detail = '5016';

String boardDetailInfo2(String boardId) {
  return "{\"root\":[{\"boardid\":\"$boardId\"}]}";
}

const area_info = '5015';

String areaInfo(int deptId) {
  return "{\"root\":[{\"deptId\":$deptId}]}";
}

const change_area_info = '0006';

String changeAreaInfo(BoardInfo detail) {
  return json.encode(detail);
}

const baseUrl = 'http://113.45.190.183:8102/upload';

const yz_url = 'http://app.izis.cn/';

const yz_se_url = 'http://app.izis.cn/mygoedu/';

const base_url2 = 'http://api.izis.cn/mygomarket/getdataserver';

const base_url3 = 'http://api.izis.cn/mygomarket/postdataserver';

const upload_url = 'http://app.izis.cn/GoWebService/';

const upload_url2 = 'http://app.izis.cn/GoWebService/';

const upload_url3 = 'http://teach.izis.cn/mygoedu/';

const miuiUrl = 'https://dev.mi.com/distribute?userId=114057042';

const vivoUrl = 'https://dev.vivo.com.cn/appLists';

const oppoUrl =
    'https://open.oppomobile.com/new/mcom/app/detail?app_id=3363886&pkg_symbol=0';

const tencentUrl =
    'https://app.open.qq.com/p/home?url=https%3A%2F%2Fapp.open.qq.com%2Fp%2Fapp%2Flist';

const hwUrl =
    'https://developer.huawei.com/consumer/cn/service/josp/agc/index.html#/myApp';

const baiduUrl = 'https://app.baidu.com/newapp/apps/list';

const xmDebugUrl =
    'https://testit.miui.com/remote?cUserId=XrOdVrwWmGGUrYlP30Pv359KKbw';

const vivoDebugUrl = 'https://dev.vivo.com.cn/vcl/#/remote/device/list';

const oppoDebugUrl =
    'https://open.oppomobile.com/octpcloud/octpcloud/index.html#/?source=open_appdetail_zhenji';

const hwDebugUrl =
    'https://developer.huawei.com/consumer/cn/service/josp/agc/index.html#/myProject/388421841222160389/9249519184596051206?appId=111025335';

const juejinUrl = 'https://juejin.cn/column/7101817687877091358';

const ipQueryUrl = 'https://qifu-api.baidubce.com/ip/local/geo/v1/district';

const phoneNumQueryUrl = 'https://cx.shouji.360.cn/phonearea.php?number=';

const melosProblemUrl = 'https://docs.qq.com/doc/DVktjZFFNU1ZMcXB6';

const rustStudyUrl = 'https://docs.qq.com/doc/DVk9PelJXckJIanlL';

const configUrl = 'http://113.45.190.183:8099/config.json';

const classInfo = '/info/';
